
<!--判断是否存在添加表单信息-->
<?php
include ("../inc/config.inc.php");
include ("../inc/mysql.inc.php");
include ("inc/tool.inc.php");
$link = connect();
if (isset($_POST['submit'])) {
    $check_type = "add";
    include ("check/father_module_check.inc.php");
    $_POST = escape($link,$_POST);
    $query = "insert into sfk_father_module(module_name,sort) values ('{$_POST['module_name']}','{$_POST['sort']}')";
    if (execute($link,$query)) {
        skip('father_module.php','ok','添加板块成功');
    } else {
        skip('father_module_add.php','error','添加失败');
    }
}
?>
<?php
$template['title'] = '添加父板块';
include "inc/header.inc.php"
?>
<div id="main">
	<div class="title" style="margin-bottom:20px;">添加父版块</div>
	<form method="post" >
		<table class="au">
			<tr>
				<td>版块名称</td>
				<td><input name="module_name" type="text" /></td>
				<td>
					版块名称不得为空，最大不得超过66个字符
				</td>
			</tr>
			<tr>
				<td>排序</td>
				<td><input name="sort" type="text" /></td>
				<td>
					填写一个数字即可
				</td>
			</tr>
		</table>
		<input style="margin-top:20px;cursor:pointer;" class="btn" type="submit" name="submit" value="添加"  />
	</form>
</div>
<script>
    function del() {
        var msg = "请确定彻底删除吗？\n\n";
        var mes = "该操作不可逆！！\n\n请再次确定 ";
        if (confirm(msg) == true && confirm(mes)) {
            return true;
        } else {
            return false;
        }
    }
</script>
<?php include 'inc/footer.inc.php'?>